package controller

import (
	"gin/common/lib"
	"gin/common/lib/rabbitmq"
	"gin/middleware"

	"github.com/gin-gonic/gin"
)

type TestController struct {
}

func TestRegister(router lib.RegisterRouterGroup, needLoginRouter lib.RegisterRouterGroup) {
	c := TestController{}
	needLoginRouter.POST("/test", c.CornTest)
	needLoginRouter.POST("/send", c.SendTest)
}

func (*TestController) CornTest(c *gin.Context) {
	rabbitmq.RabbitMqConn.SendMessage([]byte("hello world"), "hello")
	middleware.Success(c)
}
func (*TestController) SendTest(c *gin.Context) {
	rabbitmq.RabbitMqConn.GetMessage()
	middleware.Success(c)
}
